import sys
from pathlib import Path
from pydantic import BaseSettings


class Settings(BaseSettings):
    NAME: str
    PORT: int

    CONSUL_HOST: str
    CONSUL_PORT: int

    PG_HOST: str
    PG_PORT: int
    PG_DATABASE: str
    PG_USERNAME: str
    PG_PASSWORD: str

    class Config:
        env_file = str(Path(sys.argv[0]).parent / 'config_zhongzhi.env')


settings = Settings()
